package com.kzj.controller;

import com.kzj.domain.dto.UserLoginDTO;
import com.kzj.global.re.Result;
import com.kzj.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/common")
@Api(tags="通用接口")
public class CommonController {
    @Autowired
    CommonService commonService;
    @PostMapping("/login")
    @ApiOperation("")
    public Result login(@RequestBody UserLoginDTO userLoginDTO)
    {
        return commonService.login(userLoginDTO);
    }
    @PostMapping("/sendImageCode")
    public Result sendImageCode(@RequestBody UserLoginDTO userLoginDTO, HttpServletResponse response)
    {
        return commonService.sendImageCode(userLoginDTO,response);
    }

}
